package com.gugee.ins.web.service;

import com.gugee.ins.web.dto.FollowerSearch;
import com.gugee.ins.web.dto.RankDto;
import com.gugee.ins.web.repository.InsRkBloggerFlMonthRepository;
import com.xiguaji.boot.toolkit.jdbc.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InsRankService {

    @Autowired
    InsRkBloggerFlMonthRepository insRkBloggerFlMonthRepository;


    /**
     * 粉丝排行榜最新更新时间
     * @return
     */
    public long getUpdateTimeByFollowerRank(String category,String nation){
        return insRkBloggerFlMonthRepository.getMaxCreateTime(category,nation);
    }

    /**
     * 粉丝排行榜最新排行时间
     * @return
     */
    public int getUpdateDateCodeByFollowerRank(String category,String nation){
        return insRkBloggerFlMonthRepository.getMxDateCode(category,nation);
    }

    /**
     * 总榜
     * @return
     */
    public Page<RankDto> getFollowerRankPage(FollowerSearch followerSearch){
        return insRkBloggerFlMonthRepository.findPage(followerSearch);
    }

    public List<RankDto> getFollowerRankList(FollowerSearch followerSearch){
        return insRkBloggerFlMonthRepository.findList(followerSearch);
    }
}
